
class MessagesBean {
  List<MessagesDataBean> data;
  Map<String,dynamic> toJson()=>jsonFromMessagesBean(this);
  MessagesBean(Map<String,dynamic> json){
    jsonToMessagesBean(this,json);
  }
}

class MessagesDataBean {
  String time;
  List<MessagesDataListBean> list;
  Map<String,dynamic> toJson()=>jsonFromMessagesDataBean(this);
  MessagesDataBean(Map<String,dynamic> json){
    jsonToMessagesDataBean(this,json);
  }
}

class MessagesDataListBean {
  int id;
  int userId;
  String value;
  int mold;
  int isRead;
  int receiveId;
  String createTime;
  Map<String,dynamic> toJson()=>jsonFromMessagesDataListBean(this);
  MessagesDataListBean(Map<String,dynamic> json){
    jsonToMessagesDataListBean(this,json);
  }
}


//////////////////////////////////////////////////////////////

//----------------------------解析方法-------------------------

/////////////////////////////////////////////////////////////



void jsonToMessagesBean(MessagesBean bean,Map<String,dynamic> json){
  if(json==null) return;
  bean.data=[];
  for(var item in json['data']??[]){
    bean.data.add(MessagesDataBean(item));
  }

}
void jsonToMessagesDataBean(MessagesDataBean bean,Map<String,dynamic> json){
  if(json==null) return;
  bean.time=json['time']?.toString()??'';
  bean.list=[];
  for(var item in json['list']??[]){
    bean.list.add(MessagesDataListBean(item));
  }

}
void jsonToMessagesDataListBean(MessagesDataListBean bean,Map<String,dynamic> json){
  if(json==null) return;
  bean.id=int.parse(json['id']?.toString()??'0');
  bean.userId=int.parse(json['user_id']?.toString()??'0');
  bean.value=json['value']?.toString()??'';
  bean.mold=int.parse(json['mold']?.toString()??'0');
  bean.isRead=int.parse(json['is_read']?.toString()??'0');
  bean.receiveId=int.parse(json['receive_id']?.toString()??'0');
  bean.createTime=json['create_time']?.toString()??'';
}
Map<String,dynamic> jsonFromMessagesBean(MessagesBean bean)=>{
  'data':bean.data,
};
Map<String,dynamic> jsonFromMessagesDataBean(MessagesDataBean bean)=>{
  'time':bean.time,
  'list':bean.list,
};
Map<String,dynamic> jsonFromMessagesDataListBean(MessagesDataListBean bean)=>{
  'id':bean.id,
  'user_id':bean.userId,
  'value':bean.value,
  'mold':bean.mold,
  'is_read':bean.isRead,
  'receive_id':bean.receiveId,
  'create_time':bean.createTime,
};
